package com.example.demo.demos.web.mapper;

import com.example.demo.demos.web.entity.Pinpai;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PinpaiMapper {
    @Select("select * from pinpai where name like concat ('%',#{name},'%') limit #{pageNum}, #{pageSize}")
    List<Pinpai> select(@Param("name") String name,@Param("pageNum") Integer pageNum,@Param("pageSize") Integer pageSize );
@Select("select count(*) from pinpai where name like concat ('%',#{name},'%')")
    Integer totalselect(@Param("name") String name);
@Insert("insert into pinpai (name,icon) Values (#{name},#{icon})")
    Integer addpinpai(Pinpai pinpai);
@Update("update pinpai set name=#{name},icon=#{icon} where id=#{id}")
    Integer updatepinpia(Pinpai pinpai);
@Delete("delete from pinpai where id=#{id}")
    Integer shanchupp(@Param("id") String id);
@Select("select * from pinpai")
    List<Pinpai> selectall();
}
